home *** CD-ROM | disk | FTP | other *** search
/ PD ROM 1 / PD ROM Volume I - Macintosh Software from BMUG (1988).iso / Stacks / Hyper Education / Mathematics / Addition / card_7124.txt < prev    next >
Encoding:
Text File  |  1988-04-19  |  11.2 KB  |  498 lines

  1. -- card: 7124 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 6762
  5. -- name: 
  6.  
  7.  
  8. -- part 1 (button)
  9. -- low flags: 00
  10. -- high flags: 0001
  11. -- rect: left=14 top=87 right=178 bottom=110
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Smiley
  20.  
  21.  
  22. -- part 2 (button)
  23. -- low flags: 00
  24. -- high flags: 0001
  25. -- rect: left=251 top=87 right=180 bottom=351
  26. -- title width / last selected line: 0
  27. -- icon id / first selected line: 0 / 0
  28. -- text alignment: 1
  29. -- font id: 0
  30. -- text size: 12
  31. -- style flags: 0
  32. -- line height: 16
  33. -- part name: Frowney
  34.  
  35.  
  36. -- part 3 (button)
  37. -- low flags: 00
  38. -- high flags: 8003
  39. -- rect: left=354 top=102 right=139 bottom=468
  40. -- title width / last selected line: 0
  41. -- icon id / first selected line: 0 / 0
  42. -- text alignment: 1
  43. -- font id: 0
  44. -- text size: 12
  45. -- style flags: 0
  46. -- line height: 16
  47. -- part name: Next Problem
  48. ----- HyperTalk script -----
  49. on mouseUp
  50.   if field "Flag" = 0 then exit mouseUp
  51.   show button "Smiley"
  52.   show button "Frowney"
  53.   put empty into field "Comment"
  54.   put "  " into field "Addend1"
  55.   put "  " into field "Addend2"
  56.   put empty into field "Sum"
  57.   if field "Attempts" = second word of bkgnd field "Options" then
  58.     put field "Attempts" into attempts
  59.     put field "Correct" into correct
  60.     put field "Percent" into percent
  61.     put field "Name" into name
  62.     put third word of field "Options" into skill
  63.     put "O" into field "Attempts"
  64.     put "O" into field "Correct"
  65.     put "O" into field "Percent"
  66.     set the lockScreen to true
  67.     set the cursor to 4
  68.     go to first card of bkgnd "Users"
  69.     rotateData
  70.     put name into line 1 of field "name"
  71.     put the date into line 1 of field "Date"
  72.     put skill into line 1 of field "Skill"
  73.     put attempts into line 1 of field "Attempts"
  74.     put correct into line 1 of field "Correct"
  75.     put percent into line 1 of field "Percent"
  76.     pop card
  77.     exit mouseUp
  78.   end if
  79.   get the random of 70
  80.   add 9 to it
  81.   if second char of it < 2 then add 2 to it
  82.   put it into field "Addend1"
  83.   if second char of field "Addend1" >1 then
  84.     put 10 into it
  85.     subtract second char of field "Addend1" from it
  86.     put it into lowerBound
  87.     if it >1 then
  88.       repeat until it > lowerBound
  89.         get the random of 9
  90.       end repeat
  91.     else
  92.       get the random of 9
  93.       add 1 to it
  94.     end if
  95.   else
  96.     put 9 into it
  97.   end if
  98.   put it into second char of field "Addend2"
  99.   put 7 into it
  100.   subtract first char of field "Addend1" from it
  101.   if it >0 then get the random of it else put 1 into it
  102.   put it into first char of field "Addend2"
  103.  
  104.   put field "Addend1" into answer
  105.   add field "Addend2" to answer
  106.   put "   " into field "Sum"
  107.   put "0" into field "Flag"
  108.   put "?" into char 3 of field "Sum"
  109. end mouseUp
  110.  
  111. on rotateData
  112.   repeat with x = 11 down to 1
  113.     if line x of field "Name" is empty then next repeat
  114.     put x into nextLine
  115.     add 1 to nextLine
  116.     get line x of field "Name"
  117.     put it into line nextLine of field "Name"
  118.     get line x of field "Date"
  119.     put it into line nextLine of field "Date"
  120.     get line x of field "Skill"
  121.     put it into line nextLine of field "Skill"
  122.     get line x of field "Attempts"
  123.     put it into line nextLine of field "Attempts"
  124.     get line x of field "Correct"
  125.     put it into line nextLine of field "Correct"
  126.     get line x of field "Percent"
  127.     put it into line nextLine of field "Percent"
  128.   end repeat
  129. end rotateData
  130.  
  131.  
  132.  
  133.  
  134. -- part 4 (button)
  135. -- low flags: 00
  136. -- high flags: 8003
  137. -- rect: left=355 top=161 right=194 bottom=388
  138. -- title width / last selected line: 0
  139. -- icon id / first selected line: 0 / 0
  140. -- text alignment: 1
  141. -- font id: 0
  142. -- text size: 12
  143. -- style flags: 0
  144. -- line height: 16
  145. -- part name: 7
  146. ----- HyperTalk script -----
  147. on mouseUp
  148.   repeat with x=3 down to 2
  149.     if char x of field "Sum" is "?" then
  150.       put "7" into char x of field "Sum"
  151.       put x into it
  152.       subtract 1 from it
  153.       if  x>2 then put "?" into char it of field "Sum"
  154.       exit mouseUp
  155.     end if
  156.   end repeat
  157. end mouseUp
  158.  
  159.  
  160.  
  161. -- part 5 (button)
  162. -- low flags: 00
  163. -- high flags: 8003
  164. -- rect: left=395 top=161 right=194 bottom=427
  165. -- title width / last selected line: 0
  166. -- icon id / first selected line: 0 / 0
  167. -- text alignment: 1
  168. -- font id: 0
  169. -- text size: 12
  170. -- style flags: 0
  171. -- line height: 16
  172. -- part name: 8
  173. ----- HyperTalk script -----
  174. on mouseUp
  175.   repeat with x=3 down to 2
  176.     if char x of field "Sum" is "?" then
  177.       put "8" into char x of field "Sum"
  178.       put x into it
  179.       subtract 1 from it
  180.       if  x>2 then put "?" into char it of field "Sum"
  181.       exit mouseUp
  182.     end if
  183.   end repeat
  184. end mouseUp
  185.  
  186.  
  187.  
  188. -- part 6 (button)
  189. -- low flags: 00
  190. -- high flags: 8003
  191. -- rect: left=435 top=162 right=194 bottom=467
  192. -- title width / last selected line: 0
  193. -- icon id / first selected line: 0 / 0
  194. -- text alignment: 1
  195. -- font id: 0
  196. -- text size: 12
  197. -- style flags: 0
  198. -- line height: 16
  199. -- part name: 9
  200. ----- HyperTalk script -----
  201. on mouseUp
  202.   repeat with x=3 down to 2
  203.     if char x of field "Sum" is "?" then
  204.       put "9" into char x of field "Sum"
  205.       put x into it
  206.       subtract 1 from it
  207.       if  x>2 then put "?" into char it of field "Sum"
  208.       exit mouseUp
  209.     end if
  210.   end repeat
  211. end mouseUp
  212.  
  213.  
  214.  
  215. -- part 7 (button)
  216. -- low flags: 00
  217. -- high flags: 8003
  218. -- rect: left=356 top=201 right=233 bottom=389
  219. -- title width / last selected line: 0
  220. -- icon id / first selected line: 0 / 0
  221. -- text alignment: 1
  222. -- font id: 0
  223. -- text size: 12
  224. -- style flags: 0
  225. -- line height: 16
  226. -- part name: 4
  227. ----- HyperTalk script -----
  228. on mouseUp
  229.   repeat with x=3 down to 2
  230.     if char x of field "Sum" is "?" then
  231.       put "4" into char x of field "Sum"
  232.       put x into it
  233.       subtract 1 from it
  234.       if  x>2 then put "?" into char it of field "Sum"
  235.       exit mouseUp
  236.     end if
  237.   end repeat
  238. end mouseUp
  239.  
  240.  
  241.  
  242. -- part 8 (button)
  243. -- low flags: 00
  244. -- high flags: 8003
  245. -- rect: left=395 top=202 right=234 bottom=428
  246. -- title width / last selected line: 0
  247. -- icon id / first selected line: 0 / 0
  248. -- text alignment: 1
  249. -- font id: 0
  250. -- text size: 12
  251. -- style flags: 0
  252. -- line height: 16
  253. -- part name: 5
  254. ----- HyperTalk script -----
  255. on mouseUp
  256.   repeat with x=3 down to 2
  257.     if char x of field "Sum" is "?" then
  258.       put "5" into char x of field "Sum"
  259.       put x into it
  260.       subtract 1 from it
  261.       if  x>2 then put "?" into char it of field "Sum"
  262.       exit mouseUp
  263.     end if
  264.   end repeat
  265. end mouseUp
  266.  
  267.  
  268.  
  269. -- part 9 (button)
  270. -- low flags: 00
  271. -- high flags: 8003
  272. -- rect: left=435 top=201 right=233 bottom=466
  273. -- title width / last selected line: 0
  274. -- icon id / first selected line: 0 / 0
  275. -- text alignment: 1
  276. -- font id: 0
  277. -- text size: 12
  278. -- style flags: 0
  279. -- line height: 16
  280. -- part name: 6
  281. ----- HyperTalk script -----
  282. on mouseUp
  283.   repeat with x=3 down to 2
  284.     if char x of field "Sum" is "?" then
  285.       put "6" into char x of field "Sum"
  286.       put x into it
  287.       subtract 1 from it
  288.       if  x>2 then put "?" into char it of field "Sum"
  289.       exit mouseUp
  290.     end if
  291.   end repeat
  292. end mouseUp
  293.  
  294.  
  295.  
  296. -- part 10 (button)
  297. -- low flags: 00
  298. -- high flags: 8003
  299. -- rect: left=356 top=242 right=274 bottom=389
  300. -- title width / last selected line: 0
  301. -- icon id / first selected line: 0 / 0
  302. -- text alignment: 1
  303. -- font id: 0
  304. -- text size: 12
  305. -- style flags: 0
  306. -- line height: 16
  307. -- part name: 1
  308. ----- HyperTalk script -----
  309. on mouseUp
  310.   repeat with x=3 down to 2
  311.     if char x of field "Sum" is "?" then
  312.       put "1" into char x of field "Sum"
  313.       put x into it
  314.       subtract 1 from it
  315.       if  x>2 then put "?" into char it of field "Sum"
  316.       exit mouseUp
  317.     end if
  318.   end repeat
  319. end mouseUp
  320.  
  321.  
  322.  
  323. -- part 11 (button)
  324. -- low flags: 00
  325. -- high flags: 8003
  326. -- rect: left=395 top=241 right=273 bottom=428
  327. -- title width / last selected line: 0
  328. -- icon id / first selected line: 0 / 0
  329. -- text alignment: 1
  330. -- font id: 0
  331. -- text size: 12
  332. -- style flags: 0
  333. -- line height: 16
  334. -- part name: 2
  335. ----- HyperTalk script -----
  336. on mouseUp
  337.   repeat with x=3 down to 2
  338.     if char x of field "Sum" is "?" then
  339.       put "2" into char x of field "Sum"
  340.       put x into it
  341.       subtract 1 from it
  342.       if  x>2 then put "?" into char it of field "Sum"
  343.       exit mouseUp
  344.     end if
  345.   end repeat
  346. end mouseUp
  347.  
  348.  
  349.  
  350. -- part 12 (button)
  351. -- low flags: 00
  352. -- high flags: 8003
  353. -- rect: left=436 top=242 right=274 bottom=468
  354. -- title width / last selected line: 0
  355. -- icon id / first selected line: 0 / 0
  356. -- text alignment: 1
  357. -- font id: 0
  358. -- text size: 12
  359. -- style flags: 0
  360. -- line height: 16
  361. -- part name: 3
  362. ----- HyperTalk script -----
  363. on mouseUp
  364.   repeat with x=3 down to 2
  365.     if char x of field "Sum" is "?" then
  366.       put "3" into char x of field "Sum"
  367.       put x into it
  368.       subtract 1 from it
  369.       if  x>2 then put "?" into char it of field "Sum"
  370.       exit mouseUp
  371.     end if
  372.   end repeat
  373. end mouseUp
  374.  
  375.  
  376.  
  377. -- part 13 (button)
  378. -- low flags: 00
  379. -- high flags: 8003
  380. -- rect: left=355 top=281 right=313 bottom=407
  381. -- title width / last selected line: 0
  382. -- icon id / first selected line: 0 / 0
  383. -- text alignment: 1
  384. -- font id: 0
  385. -- text size: 12
  386. -- style flags: 0
  387. -- line height: 16
  388. -- part name: 0
  389. ----- HyperTalk script -----
  390. on mouseUp
  391.   repeat with x=3 down to 2
  392.     if char x of field "Sum" is "?" then
  393.       put "0" into char x of field "Sum"
  394.       put x into it
  395.       subtract 1 from it
  396.       if  x>2 then put "?" into char it of field "Sum"
  397.       exit mouseUp
  398.     end if
  399.   end repeat
  400. end mouseUp
  401.  
  402.  
  403.  
  404. -- part 14 (button)
  405. -- low flags: 00
  406. -- high flags: 8003
  407. -- rect: left=414 top=281 right=313 bottom=468
  408. -- title width / last selected line: 0
  409. -- icon id / first selected line: 0 / 0
  410. -- text alignment: 1
  411. -- font id: 0
  412. -- text size: 12
  413. -- style flags: 0
  414. -- line height: 16
  415. -- part name: Enter
  416. ----- HyperTalk script -----
  417. on mouseUp
  418.   global answer
  419.   if field "SUM" < 1 then exit mouseUp
  420.   if field "Flag" > 0 then exit mouseUp
  421.   put field "Addend1" into answer
  422.   add field "Addend2" to answer
  423.   add 1 to field "Attempts"
  424.   if field "Sum" = answer then
  425.     add 1 to field "Correct"
  426.     get field "Correct"
  427.     divide it by field "Attempts"
  428.     multiply it by 100
  429.     put round(it) into field "Percent"
  430.     celebrate
  431.   else
  432.     get field "Correct"
  433.     divide it by field "Attempts"
  434.     multiply it by 100
  435.     put round(it) into field "Percent"
  436.     nag
  437.   end if
  438. end mouseUp
  439.  
  440. on celebrate
  441.   put "Correct" into line 1 of field "Comment"
  442.   put first word of bkgnd field "Name" into line 2 of field "Comment"
  443.   hide button "Smiley"
  444.   put "1" into field "Flag"
  445.   if first word of bkgnd field "Options" = "Y" then
  446.     play "Harpsichord" tempo 200 "g4e c5 e gh eq gh"
  447.   end if
  448. end celebrate
  449.  
  450. on nag
  451.   global answer
  452.   put "WRONG!" into line 1 of field "Comment"
  453.   put "The answer is "& answer & "." into line 3 of field "Comment"
  454.   hide button "Frowney"
  455.   put "2" into field "Flag"
  456.   if first word of bkgnd field "Options" = "Y" then
  457.     play "boing" tempo 200 "gq c e a"
  458.   end if
  459. end nag
  460.  
  461.  
  462.  
  463. -- part contents for background part 2
  464. ----- text -----
  465. 0
  466.  
  467. -- part contents for background part 3
  468. ----- text -----
  469. 0
  470.  
  471. -- part contents for background part 4
  472. ----- text -----
  473. 0
  474.  
  475. -- part contents for background part 5
  476. ----- text -----
  477. 72
  478.  
  479. -- part contents for background part 6
  480. ----- text -----
  481. 19
  482.  
  483. -- part contents for background part 9
  484. ----- text -----
  485. 0
  486.  
  487. -- part contents for background part 10
  488. ----- text -----
  489. Y 5 5
  490.  
  491. -- part contents for background part 11
  492. ----- text -----
  493. records
  494.  
  495.  
  496. -- part contents for background part 7
  497. ----- text -----
  498.   ?